// 引入defineStore用于创建store
import { defineStore } from "pinia";

// 定义并暴露一个store
export const useMapStore = defineStore("defineMap", {
  // 动作
  actions: {},
  // 状态
  state() {
    return {
      map: null,
      timer: 0, // 基本信息表格
      currentCar: "",
      basicInfoTableData: [
        {
          licensePlate: "湘A 123456",
          licenseType: "湖南长沙",
          licenseColor: "蓝色",
          carColor: "白色",
          owner: "谢司机",
          phone: "12345678900",
          approvedLoadCapacity: "2.5T",
          nuclearTonnage: "3T",
          authorizedSeatingCapacity: "3"
        }
      ],
      basicInfoTableTotal: 1,
      basicInfoTableCurrentPage: 1,
      basicInfoTablePageSize: 5,
      // 轨迹信息表格（当天）
      trajectoryTodayTableData: [
        {
          licensePlate: "湘A 111111",
          startLongitude: "XXX",
          startDimension: "XXX",
          endLongitude: "XXX",
          endDimension: "XXX",
          kilometerDriven: "200KM",
          averageVehicleSpeed: "50KM/H"
        }
      ],
      trajectoryTodayTableTotal: 0,
      trajectoryTodayTableCurrentPage: 1,
      trajectoryTodayTablePageSize: 5, 
      // 轨迹信息表格（当周）
      trajectoryWeekTableData: [{
        licensePlate: "湘A 111111",
        startLongitude: "XXX",
        startDimension: "XXX",
        endLongitude: "XXX",
        endDimension: "XXX",
        kilometerDriven: "200KM",
        averageVehicleSpeed: "50KM/H"
      }],
      trajectoryWeekTableTotal: 0,
      trajectoryWeekTableCurrentPage: 1,
      trajectoryWeekTablePageSize: 5,  
      // 轨迹信息表格（当月）
      trajectoryMonthTableData: [{
        licensePlate: "湘A 111111",
        startLongitude: "XXX",
        startDimension: "XXX",
        endLongitude: "XXX",
        endDimension: "XXX",
        kilometerDriven: "200KM",
        averageVehicleSpeed: "50KM/H"
      }],
      trajectoryMonthTableTotal: 0,
      trajectoryMonthTableCurrentPage: 1,
      trajectoryMonthTablePageSize: 5,
    };
  },
  // 计算
  getters: {}
});
